<?php namespace Cms\Controller;

use Cms\Controller;
/**
 * 访问权限验证
 * @author 后盾网向军 <2300071698@qq.com>
 */
class AuthController extends Controller
{
    public function __construct()
    {
    	//登录检测
    	if(!Api('User/isLogin'))
    	{
    		go('Cms/Login/login');
    	}

        //权限检测
        if(!Api('Cms/Api/Access/verify'))
        {
        	if(IS_AJAX)
        	{
            $this->ajaxReturn(1,Api('Access/getError'));
            }
            else
            {
            	$this->error(Api('Access/getError'));
            }
        }
        parent::__construct();
    }
}












